<html>
<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" %>
<%@include file="/quick/include/common.jsp"%>
<%@include file="/quick/include/globalScope.jsp"%>
  <head>
    <title><c:out value="${model.title}"/></title>
  </head>

<script>
Ext.onReady(function(){
   var params=Ext.decode('<c:out value="${model.json}" escapeXml="false"/>');
   var electiveYear,electiveSemester;
   Ext.each(params,function(param){
     if(param.NAME=='REEXAMINATION_YEAR'){
       electiveYear=param.VALUE1;
     }
     if(param.NAME=='REEXAMINATION_SEMESTER'){
       electiveSemester=param.VALUE1;
     } 
   });
   var schoolYear=Ext.decode('<c:out value="${model.schoolYear}" escapeXml="false"/>');
   var yearArray=[['','请选择']];
   Ext.each(schoolYear,function(r){
     var year=[r.CODE,r.NAME];
     yearArray.push(year);
   });
   var yearStore={
     'fields':['value','text'],
     data:yearArray
   };
   var schoolSemester=Ext.decode('<c:out value="${model.schoolSemester}" escapeXml="false"/>');
   var semesterArray=[['','请选择']];
   Ext.each(schoolSemester,function(r){
     var semester=[r.CODE,r.NAME];
     semesterArray.push(semester);
   });
   var semesterStore={
     'fields':['value','text'],
     data:semesterArray
   };
   
	var form = new Ext.form.FormPanel({
	      labelAlign:'right',
	      title:'补考参数设置',
	      labelWidth:80,
	      region:'north',
	      height:g_height/3,
	      frame:true,
	      width:320,
		  url:g_rootPath+'ajax/system/parameter/save.html',	      
	      items:[{},{
            xtype:'combo',   
            fieldLabel:'补考学年度',  
            value:electiveYear, 
            store: new Ext.data.SimpleStore(yearStore),   
            editable: false,   
            hiddenName:'REEXAMINATION_YEAR',   
            displayField:'text',   
            valueField:'value',   
            typeAhead:true,   
            mode: 'local',   
            triggerAction: 'all',   
            emptyText:'请选择',   
            selectOnFocus:true,   
            resizable:true,   
            allowBlank:false,   
            anchor:'90%',
            forceSelection:true           
         },{},{
            xtype:'combo',   
            fieldLabel:'补考学期',   
            value:electiveSemester,
            store: new Ext.data.SimpleStore(semesterStore),   
            editable: false,   
            hiddenName:'REEXAMINATION_SEMESTER',   
            displayField:'text',   
            valueField:'value',   
            typeAhead:true,   
            mode: 'local',   
            triggerAction: 'all',   
            emptyText:'请选择',   
            selectOnFocus:true,   
            resizable:true,   
            allowBlank:false,   
            anchor:'90%',
            forceSelection:true           
         }],
         buttons:[{text:'修改',handler:function(){
           form.getForm().submit({
             success:function(frm,action){
               Ext.Msg.alert('信息',action.result.msg);
             },
             failure:function(){}
           });
         }},{text:'重置',handler:function(){
           form.getForm().reset();
         }}] 
          
	});
	
	form.render('parameter_form');   
   
});
</script>  
    <c:if test="${not empty message}">
      <div  align="left" id="title" style="height:40px;vertical-align:bottom;bgcolor:blue;"><br><h3><STRONG><c:out value='${message}'/></STRONG></h3></div>
    </c:if>

<br>
<br>
<br>


<div id="parameter_form" align=center></div>  
  
</html>   
